<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <title> ISPC </title>
    <meta name="description" content="">
    <meta name="author" content="">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <!-- #CSS Links -->
    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/font-awesome.min.css">

    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-skins.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-datetimepicker.css"/>

    <!-- Demo purpose only: goes with demo.js, you can delete this css when designing your own WebApp -->
    <link rel="stylesheet" type="text/css" media="screen" href="css/demo.min.css">

    <link rel="stylesheet" type="text/css" media="screen" href="css/main.css"/>

    <link rel="stylesheet" type="text/css" media="screen" href="css/editor.dataTables.min.css">

    <!-- #FAVICONS -->
    <link rel="shortcut icon" href="img/favicon/favicon.ico" type="image/x-icon">
    <link rel="icon" href="img/favicon/favicon.ico" type="image/x-icon">

    <!-- #GOOGLE FONT -->
    <link rel="stylesheet" href="css/localFont.css">

    <!-- #APP SCREEN / ICONS -->
    <link rel="apple-touch-icon" href="img/splash/sptouch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="img/splash/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="img/splash/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="img/splash/touch-icon-ipad-retina.png">

    <!-- iOS web-app metas : hides Safari UI Components and Changes Status Bar Appearance -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Startup image for web apps -->
    <link rel="apple-touch-startup-image" href="img/splash/ipad-landscape.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)">
    <link rel="apple-touch-startup-image" href="img/splash/ipad-portrait.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)">
    <link rel="apple-touch-startup-image" href="img/splash/iphone.png" media="screen and (max-device-width: 320px)">

    <script src="js/requirejs/require-2.1.11.js" data-main="js/core/index" defer async="true"></script>

    <style>
        .minified #main {
            margin-left: 0px !important;
        }

        #header > :first-child, aside {
            width: 150px;
        }

        .jarviswidget {
            margin: 0 0 5px;
        }

        section article {
            padding-right: 5px !important;
            padding-left: 5px !important;
        }
    </style>
</head>
<body class="minified">

<header id="header" class="collapse navbar-collapse bg-color-white">
    <div id="logo-group">
        <span id="logo"> Intelligent Group </span>
    </div>
    <input type="hidden" class="d-header-user-id" value="${sessionScope.user.id}"/>
    <input type="hidden" class="d-header-user-name" value="${sessionScope.user.loginName}"/>
    <input type="hidden" class="d-header-user-role" value="${sessionScope.user.roleNames}"/>
    <input type="hidden" class="d-header-user-pageSize" value="${sessionScope.user.pageSize}"/>
    <shiro:hasAnyPermission name="analysis, analysis:spc, analysis:spc:view, analysis:report, analysis:report:view, analysis:report:export, analysis:grr, analysis:grr:view, analysis:tolerance, analysis:tolerance:view">
        <ul id="ul_navbar" class="nav navbar-nav">
            <shiro:hasPermission name="analysis:spc:view">
                <li class="active">
                    <a id="nav_global_spc" href="#analysis/spc">SPC</a>
                </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="analysis:report:view">
                <li>
                    <a id="nav_global_report" href="#analysis/report">Report</a>
                </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="analysis:grr:view">
                <li>
                    <a id="nav_global_grr" href="#analysis/grr">GRR</a>
                </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="analysis:tolerance:view">
                <li>
                    <a id="nav_global_tolerance" href="#analysis/tolerance">Tolerance</a>
                </li>
            </shiro:hasPermission>
            <shiro:hasAnyPermission name="project, project:view">
                <li>
                    <a id="nav_global_project" href="#project"><spring:message code="MENU_PROJECT"/></a>
                </li>
            </shiro:hasAnyPermission>

        </ul>
    </shiro:hasAnyPermission>
    <div class="pull-right">
        <!-- logout button -->
        <div id="logout" class="btn-header transparent pull-right">
            <span> <a href="logout" title="Sign Out" data-action="userLogout" data-logout-msg="You can improve your security further after logging out by closing this opened browser"><i
                    class="fa fa-sign-out"></i></a> </span>
        </div>
        <!-- end logout button -->

        <!-- fullscreen button -->
        <div id="fullscreen" class="btn-header transparent pull-right">
            <span> <a href="javascript:void(0);" data-action="launchFullscreen" title="Full Screen"><i class="fa fa-arrows-alt"></i></a> </span>
        </div>

        <div id="refresh" class="btn-header transparent pull-right" >
            <span> <a href="javascript:void(0);" data-action="resetWidgets" title="Clean Local Storage"><i class="fa fa-refresh"></i></a> </span>
        </div>
        <!-- end fullscreen button -->
        <shiro:hasAnyPermission
                name="project, project:view, data, data:view, system, system:alarmrule:view, system:user:view, system:role:view, system:permission:views, system:group:view, system:email:view, system:log:view, system:user:profile">
            <ul class="header-dropdown-list hidden-xs">
                <li class="">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-cogs"></i>
                        <i class="fa fa-angle-down"></i>
                    </a>
                    <ul class="dropdown-menu pull-right">
                        <shiro:hasAnyPermission name="data, data:view ,analysis:spc:export, system:alarmrule:view">
                            <%--<shiro:hasAnyPermission name="project, project:view">--%>
                                <%--<li>--%>
                                    <%--<a id="nav_project" href="#project"><spring:message code="MENU_PROJECT"/></a>--%>
                                <%--</li>--%>
                            <%--</shiro:hasAnyPermission>--%>
                            <%--<shiro:hasAnyPermission name="data, data:view">--%>
                            <%--<li>--%>
                            <%--<a id="nav_dataImport" href="#data/import" title="<spring:message code="MENU_SYSTEM_DATAIMPORT"/>">--%>
                            <%--<span class="menu-item-parent"><spring:message code="MENU_SYSTEM_DATAIMPORT"/></span>--%>
                            <%--</a>--%>
                            <%--</li>--%>
                            <%--</shiro:hasAnyPermission>--%>
                            <shiro:hasAnyPermission name="data, data:view">
                                <li>
                                    <a id="nav_dataImportHistory" href="#data/history" title="<spring:message code="MENU_SYSTEM_DATAIMPORT"/>">
                                        <span class="menu-item-parent">Import History</span>
                                    </a>
                                </li>
                            </shiro:hasAnyPermission>
                            <shiro:hasAnyPermission name="analysis:spc:export">
                                <li>
                                    <a id="nav_dataExportHistory" href="#exportfile/all" title="<spring:message code="MENU_SYSTEM_DATAIMPORT"/>">
                                        <span class="menu-item-parent">Export History</span>
                                    </a>
                                </li>
                            </shiro:hasAnyPermission>
                            <shiro:hasPermission name="system:alarmrule:view">
                                <li>
                                    <a id="nav_alarmRule" href="#alarmRule"><spring:message code="MENU_SYSTEM_ALARMRULE"/></a>
                                </li>
                            </shiro:hasPermission>
                            <li class="divider"></li>
                        </shiro:hasAnyPermission>

                        <shiro:hasAnyPermission name="system:user:view, system:role:view, system:permission:views, ystem:group:view">
                            <shiro:hasPermission name="system:user:view">
                                <li>
                                    <a id="nav_user" href="#user"><spring:message code="MENU_SYSTEM_USER"/></a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="system:role:view">
                                <li>
                                    <a id="nav_role" href="#role"><spring:message code="MENU_SYSTEM_ROLE"/></a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="system:permission:view">
                                <li>
                                    <a id="nav_permission" href="#permission"><spring:message code="MENU_SYSTEM_PERMISSION"/></a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="system:group:view">
                                <li>
                                    <a id="nav_group" href="#group"><spring:message code="MENU_SYSTEM_GROUP"/></a>
                                </li>
                            </shiro:hasPermission>
                            <li class="divider"></li>
                        </shiro:hasAnyPermission>
                        <shiro:hasAnyPermission name="system:email:view, system:log:view">
                            <shiro:hasPermission name="system:email:view">
                                <li>
                                    <a id="nav_email" href="#system/email"><spring:message code="MENU_SYSTEM_EMAIL"/></a>
                                </li>
                            </shiro:hasPermission>
                            <shiro:hasPermission name="system:log:view">
                                <li>
                                    <a id="nav_log" href="#system/log"><spring:message code="MENU_SYSTEM_LOG"/></a>
                                </li>
                            </shiro:hasPermission>
                            <li class="divider"></li>
                        </shiro:hasAnyPermission>
                        <shiro:hasPermission name="system:user:profile">
                            <li>
                                <a id="nav_profile" href="#user/profile"><spring:message code="USER_PROFILE"/> - ${sessionScope.user.name}</a>
                            </li>
                        </shiro:hasPermission>
                    </ul>
                </li>
            </ul>
        </shiro:hasAnyPermission>
    </div>

</header>

<aside id="left-panel" style="display:none;">
    <!-- User info -->
    <div class="login-info">
        <span> <!-- User image size is adjusted inside CSS, it should stay as it -->

            <a href="javascript:void(0);" id="show-shortcut" data-action="toggleShortcut">
                <img src="img/avatars/male.png" alt="me" class="online"/>
                <span>
                    ${sessionScope.user.name}
                </span>
                <i class="fa fa-angle-down"></i>
            </a>
        </span>
    </div>
    <!-- end user info -->
    <nav>
        <ul id="ul_leftnav">
            <li class="">
                <a id="nav_dashboard" href="dashboard" title="<spring:message code="MENU_DASHBOARD"/>">
                    <i class="fa fa-lg fa-fw fa-home"></i>
                    <span class="menu-item-parent"><spring:message code="MENU_DASHBOARD"/> </span>
                </a>
            </li>
            <shiro:hasAnyPermission name="analysis, analysis:spc, analysis:spc:view, analysis:report, analysis:report:view, analysis:report:export, analysis:grr, analysis:grr:view, analysis:tolerance, analysis:tolerance:view">
                <li class="">
                    <a id="nav_analysis" href="#" title="<spring:message code="MENU_ANALYSIS_SPC"/> <spring:message code="MENU_ANALYSIS"/>"><i class="fa fa-lg fa-fw fa-bar-chart-o"></i>
                        <span class="menu-item-parent"><spring:message code="MENU_ANALYSIS"/></span>
                    </a>
                    <ul>
                        <shiro:hasPermission name="analysis:spc:view">
                            <li>
                                <a id="nav_spc" href="analysis/spc"><spring:message code="MENU_ANALYSIS_SPC"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="analysis:report:view">
                            <li>
                                <a id="nav_report" href="analysis/report" id="historyView"><spring:message code="MENU_ANALYSIS_REPORT"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="analysis:grr:view">
                            <li>
                                <a id="nav_grr" href="analysis/grr"><spring:message code="MENU_ANALYSIS_GRR"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="analysis:tolerance:view">
                            <li>
                                <a id="nav_tolerance" href="analysis/tolerance"><spring:message code="MENU_ANALYSIS_TOLERANCE"/></a>
                            </li>
                        </shiro:hasPermission>
                    </ul>
                </li>
            </shiro:hasAnyPermission>
            <shiro:hasAnyPermission name="project, project:view">
                <li>
                    <a id="leftnav_project" href="project" title="<spring:message code="MENU_PROJECT"/>">
                        <i class="fa fa-lg fa-fw fa-pied-piper"></i>
                        <span class="menu-item-parent"><spring:message code="MENU_PROJECT"/></span>
                    </a>

                </li>
            </shiro:hasAnyPermission>
            <shiro:hasAnyPermission name="data, data:view">
                <li>
                    <a id="leftNav_dataImport" href="data/import" title="<spring:message code="MENU_SYSTEM_DATAIMPORT"/>">
                        <i class="fa fa-lg fa-fw fa-upload"></i>
                        <span class="menu-item-parent"><spring:message code="MENU_SYSTEM_DATAIMPORT"/></span>
                    </a>
                </li>
            </shiro:hasAnyPermission>
            <shiro:hasAnyPermission name="system, system:user, system:user:view, system:role, system:role:view,
             system:email, system:email:view, system:permission, system:permission:view, system:alarmrule, system:alarmrule:view, system:log, system:log:view">
                <li>
                    <a id="nav_system" href="#" title="<spring:message code="MENU_SYSTEM"/>">
                        <i class="fa fa-lg fa-fw fa-gears"></i>
                        <span class="menu-item-parent"><spring:message code="MENU_SYSTEM"/></span>
                    </a>
                    <ul>
                        <shiro:hasPermission name="system:user:view">
                            <li>
                                <a id="leftnav_user" href="user" id="userNav"><spring:message code="MENU_SYSTEM_USER"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:role:view">
                            <li>
                                <a id="leftnav_role" href="role" id="roleNav"><spring:message code="MENU_SYSTEM_ROLE"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:permission:view">
                            <li>
                                <a id="leftnav_permission" href="permission"><spring:message code="MENU_SYSTEM_PERMISSION"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:group:view">
                            <li>
                                <a id="leftnav_group" href="group"><spring:message code="MENU_SYSTEM_GROUP"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:alarmrule:view">
                            <li>
                                <a id="leftnav_alarmRule" href="alarmRule"><spring:message code="MENU_SYSTEM_ALARMRULE"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:email:view">
                            <li>
                                <a id="leftnav_email" href="system/email"><spring:message code="MENU_SYSTEM_EMAIL"/></a>
                            </li>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="system:log:view">
                            <li>
                                <a id="leftnav_log" href="system/log"><spring:message code="MENU_SYSTEM_LOG"/></a>
                            </li>
                        </shiro:hasPermission>
                    </ul>
                </li>
            </shiro:hasAnyPermission>
        </ul>
    </nav>
    <span class="minifyme" data-action="minifyMenu">
        <i class="fa fa-arrow-circle-left hit"></i>
    </span>
</aside>

<%--<jsp:include page="analysis/searchbar.jsp"/>--%>


<div id="main" role="main">
    <div id="content" class="padding-top-5">
    </div>
</div>

</body>

</html>
